// ============================================================================
// Card Components Module Styles
// - Dashboard cards, action cards, stats cards
// - Reusable card patterns with hover effects and themes
// ============================================================================

// ------------------------------
// Quick Actions Grid
// ------------------------------

.quick-actions-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  
  .action-card {
    display: flex;
    align-items: center;
    padding: 16px;
    border: 1px solid var(--el-border-color-lighter);
    border-radius: var(--border-radius-large);
    cursor: pointer;
    transition: all 0.3s ease;
    background: linear-gradient(135deg, #ffffff 0%, #f8f9fa 100%);
    text-decoration: none;
    color: inherit;
    
    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
      border-color: var(--el-color-primary-light-5);
      text-decoration: none;
      color: inherit;
    }
    
    .card-icon {
      width: 48px;
      height: 48px;
      border-radius: 12px;
      display: flex;
      align-items: center;
      justify-content: center;
      margin-right: 12px;
      color: white;
      flex-shrink: 0;
    }
    
    .card-content {
      flex: 1;
      min-width: 0;
      
      .card-title {
        margin: 0 0 4px 0;
        font-size: 16px;
        font-weight: 600;
        color: var(--el-text-color-primary);
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
      }
      
      .card-desc {
        margin: 0;
        font-size: 12px;
        color: var(--el-text-color-secondary);
        line-height: 1.4;
      }
    }
    
    .card-arrow {
      color: var(--el-text-color-placeholder);
      transition: color 0.3s ease;
      flex-shrink: 0;
      margin-left: 8px;
    }
    
    &:hover .card-arrow {
      color: var(--el-color-primary);
    }
  }
  
  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 12px;

    .action-card {
      padding: 12px;

      .card-icon {
        width: 40px;
        height: 40px;
      }

      .card-content .card-title {
        font-size: 14px;
      }
    }
  }
}

// ------------------------------
// Action Card Themes
// ------------------------------

.action-card {
  // Profile/User related
  &.profile-card .card-icon,
  &.user-card .card-icon {
    background: linear-gradient(135deg, var(--el-color-primary), var(--el-color-primary-light-3));
  }
  
  // Security/Password related
  &.password-card .card-icon,
  &.security-card .card-icon {
    background: linear-gradient(135deg, var(--el-color-danger), var(--el-color-danger-light-3));
  }
  
  // Role management
  &.role-card .card-icon {
    background: linear-gradient(135deg, var(--el-color-success), var(--el-color-success-light-3));
  }
  
  // Permission management
  &.permission-card .card-icon {
    background: linear-gradient(135deg, var(--el-color-warning), var(--el-color-warning-light-3));
  }
  
  // Settings/Configuration
  &.settings-card .card-icon,
  &.config-card .card-icon {
    background: linear-gradient(135deg, var(--el-color-info), var(--el-color-info-light-3));
  }

  // File management
  &.file-card .card-icon {
    background: linear-gradient(135deg, #8b5cf6, #a78bfa);
  }

  // Monitoring
  &.monitor-card .card-icon {
    background: linear-gradient(135deg, #06b6d4, #67e8f9);
  }

  // Analytics
  &.analytics-card .card-icon {
    background: linear-gradient(135deg, #f59e0b, #fbbf24);
  }
}

// ------------------------------
// Stats Cards
// ------------------------------

.stats-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 16px;
  margin-bottom: 24px;

  .stat-card {
    background: var(--el-bg-color);
    border: 1px solid var(--el-border-color-light);
    border-radius: var(--border-radius-large);
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;

    &:hover {
      transform: translateY(-2px);
      box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    }

    .stat-icon {
      font-size: 32px;
      margin-bottom: 12px;
      color: var(--el-color-primary);
    }

    .stat-value {
      font-size: 28px;
      font-weight: 700;
      color: var(--el-text-color-primary);
      margin-bottom: 8px;
      line-height: 1;
    }

    .stat-label {
      font-size: 14px;
      color: var(--el-text-color-secondary);
      margin-bottom: 8px;
    }

    .stat-change {
      font-size: 12px;
      font-weight: 500;
      
      &.positive {
        color: var(--el-color-success);
      }

      &.negative {
        color: var(--el-color-danger);
      }

      &.neutral {
        color: var(--el-text-color-secondary);
      }

      .change-icon {
        margin-right: 2px;
      }
    }

    // Background decoration
    &::before {
      content: '';
      position: absolute;
      top: -50%;
      right: -50%;
      width: 100px;
      height: 100px;
      background: linear-gradient(45deg, transparent, rgba(64, 158, 255, 0.05));
      border-radius: 50%;
      pointer-events: none;
    }
  }
}

// ------------------------------
// Info Cards
// ------------------------------

.info-card {
  background: var(--el-bg-color);
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--border-radius-base);
  padding: 16px;
  margin-bottom: 16px;

  .info-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;

    .info-icon {
      font-size: 18px;
      margin-right: 8px;
      color: var(--el-color-primary);
    }

    .info-title {
      font-size: 16px;
      font-weight: 500;
      color: var(--el-text-color-primary);
    }
  }

  .info-content {
    color: var(--el-text-color-regular);
    line-height: 1.6;

    p {
      margin: 0 0 8px 0;

      &:last-child {
        margin-bottom: 0;
      }
    }
  }

  .info-actions {
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--el-border-color-lighter);
    display: flex;
    gap: 8px;
  }

  // Info card variants
  &.info-success {
    border-color: var(--el-color-success-light-7);
    background: var(--el-color-success-light-9);

    .info-icon {
      color: var(--el-color-success);
    }
  }

  &.info-warning {
    border-color: var(--el-color-warning-light-7);
    background: var(--el-color-warning-light-9);

    .info-icon {
      color: var(--el-color-warning);
    }
  }

  &.info-danger {
    border-color: var(--el-color-danger-light-7);
    background: var(--el-color-danger-light-9);

    .info-icon {
      color: var(--el-color-danger);
    }
  }

  &.info-primary {
    border-color: var(--el-color-primary-light-7);
    background: var(--el-color-primary-light-9);

    .info-icon {
      color: var(--el-color-primary);
    }
  }
}

// ------------------------------
// Feature Cards
// ------------------------------

.feature-card {
  background: var(--el-bg-color);
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--border-radius-large);
  padding: 24px;
  text-align: center;
  transition: all 0.3s ease;
  height: 100%;
  display: flex;
  flex-direction: column;

  &:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.1);
    border-color: var(--el-color-primary-light-7);
  }

  .feature-icon {
    font-size: 48px;
    color: var(--el-color-primary);
    margin-bottom: 16px;
  }

  .feature-title {
    font-size: 18px;
    font-weight: 600;
    color: var(--el-text-color-primary);
    margin-bottom: 12px;
  }

  .feature-description {
    color: var(--el-text-color-secondary);
    line-height: 1.6;
    flex: 1;
    margin-bottom: 16px;
  }

  .feature-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
}

// ------------------------------
// Chart Cards
// ------------------------------

.chart-card {
  background: var(--el-bg-color);
  border: 1px solid var(--el-border-color-light);
  border-radius: var(--border-radius-base);
  overflow: hidden;

  .chart-header {
    padding: 16px;
    border-bottom: 1px solid var(--el-border-color-lighter);
    display: flex;
    align-items: center;
    justify-content: space-between;

    .chart-title {
      font-size: 16px;
      font-weight: 500;
      color: var(--el-text-color-primary);
    }

    .chart-actions {
      display: flex;
      gap: 8px;
    }
  }

  .chart-content {
    padding: 16px;
    
    .chart-container {
      width: 100%;
      height: 320px;
      
      &.chart-small {
        height: 200px;
      }

      &.chart-large {
        height: 400px;
      }
    }
  }

  .chart-footer {
    padding: 12px 16px;
    border-top: 1px solid var(--el-border-color-lighter);
    background: var(--el-fill-color-light);
    font-size: 12px;
    color: var(--el-text-color-secondary);
    text-align: center;
  }
}

// ------------------------------
// Card Grid Layouts
// ------------------------------

.card-grid {
  display: grid;
  gap: var(--gap-md);
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));

  &.card-grid-2 {
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  }

  &.card-grid-3 {
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  }

  &.card-grid-4 {
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  }

  @media (max-width: 768px) {
    grid-template-columns: 1fr;
    gap: 12px;
  }
}

// ------------------------------
// Empty State Cards
// ------------------------------

.empty-state-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 40px 20px;
  text-align: center;
  color: var(--el-text-color-secondary);
  
  .empty-icon {
    font-size: 64px;
    margin-bottom: 16px;
    color: var(--el-color-info-light-3);
  }
  
  .empty-title {
    font-size: 16px;
    font-weight: 500;
    color: var(--el-text-color-regular);
    margin-bottom: 8px;
  }
  
  .empty-description {
    font-size: 14px;
    margin-bottom: 16px;
    line-height: 1.5;
  }

  .empty-actions {
    display: flex;
    gap: 8px;
    justify-content: center;
  }
}

// ------------------------------
// Responsive Design
// ------------------------------

@media (max-width: 992px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  }

  .chart-card .chart-content .chart-container {
    height: 280px;
  }
}

@media (max-width: 768px) {
  .stats-grid {
    grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    gap: 12px;

    .stat-card {
      padding: 16px;

      .stat-value {
        font-size: 24px;
      }

      .stat-icon {
        font-size: 28px;
      }
    }
  }

  .feature-card {
    padding: 20px;

    .feature-icon {
      font-size: 40px;
    }

    .feature-title {
      font-size: 16px;
    }
  }

  .chart-card .chart-content .chart-container {
    height: 240px;
  }
}

// ------------------------------
// Print Styles
// ------------------------------

@media print {
  .action-card,
  .feature-card {
    break-inside: avoid;
    transform: none !important;
    box-shadow: none !important;
  }

  .stats-grid .stat-card {
    break-inside: avoid;
  }

  .chart-card {
    break-inside: avoid;
    
    .chart-actions {
      display: none !important;
    }
  }
}
